import React from 'react';

import {
  HashRouter,
  BrowserRouter
} from 'react-router-dom';

import {
  renderRoutes,
} from 'react-router-config';

import {
  Authorization
} from '@/components';

import app from '@/models';

import routerConfigs from '@/router';

const Router: any = __DEV__ ? BrowserRouter : HashRouter;

export default app.start(() => (
  <Router>
    <Authorization children={renderRoutes(routerConfigs)} />
  </Router>
));
